package com.fengchao.dao;

import com.fengchao.model.PfmPerformanceTicket;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created by http://my.oschina.net/wangnian on 2016/9/13.
 */
@Mapper
public interface PfmPerformanceTicketMapper {
    /**
     * 根据id查询票
     *
     * @param id
     * @return
     */
    @Select("select id,pfm_ticket_lock_sum  from pfm_performance_ticket where id = #{id}")
    PfmPerformanceTicket findById(Integer id);

    /**
     * 释放票的库存
     * @param id
     * @param lockSum
     * @return
     */
    @Update("update pfm_performance_ticket set pfm_ticket_lock_sum=#{lockSum}  where id = #{id} ")
    Integer updateTicketlockSum(@Param("id") Integer id, @Param("lockSum") Integer lockSum);

}
